import request from "./request";

/**
 * 加载树形菜单数据
 * @returns 
 */
export const findTreeMenu = async () => {
  return await request.get('/api/menu/list')
}

/**
 * 用户登录接口
 * @param {* 用户账号} username 
 * @param {* 用户密码} password 
 * @returns 返回token
 */
export const login = async (username, password) => {
  const params = new URLSearchParams();
  params.append("username", username);
  params.append("password", password);
  return await request.post('/api/user/login', params.toString(),{
    header: { 'content-type': 'application/x-www-form-urlencoded' }
  })
}